<!DOCTYPE html>
<html>
<head>
	<title>文章列表</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.css">
	<link rel="stylesheet" type="text/css" href="/stylesheets/admin.css">
	<link rel="stylesheet" type="text/css" href="/stylesheets/articleLists.css">
	<script type="text/javascript" src="//cdn.bootcss.com/jquery/1.12.2/jquery.js"></script>
</head>
<body>
	<% include admin_top.ejs%>
	<div class="container">
		<div class="page-header">
			<h2>文章列表<a href="/admin/addArticles" class="btn btn-success pull-right">添加文章+</a></h2>
		</div>
		<table class="table table-bordered">
			<tr>
				<th>ID</th>
				<th>文章标题</th>
				<th>文章内容</th>
				<th>文章图片</th>
				<th>文章分类</th>
				<th>操作</th>
			</tr>

			<% for(var i = 0;i<articles.length;i++) { %> 
			<tr height="50">
				<td class="id"><%= articles[i].aid%></td>
				<td class="title"><%= articles[i].title%></td>
				<td class="content"><%= articles[i].content%></td>
				<td class="image"><img src="<%= articles[i].img%>"></td>
				<td class="classic"><%= articles[i].name%></td>
				<td class="rewrite">
					<a href="reverse?id=<%= articles[i].aid%>"><button class="btn btn-success">编辑</button></a>
					<a href="delArticles?id=<%= articles[i].aid%>"><button class="btn btn-warning">删除</button></a>
				</td>
			</tr>
			<% } %>

		</table>

		<nav aria-label="Page navigation">
			<ul class="pagination">

				<li <% if(page==1){%>class="disabled" <%}%>><a href="<% if(page <= 1){%> ?page=1 <%}else{%> ?page=<%=page-1%> <%}%>" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>


				<% for(var i=1;i<=totlePage;i++){ %>


				<li <%if(page==i){%>class="active<%}%>"><a href="?page=<%=i%>"><%=i%></a></li>

				<% }%>


				<li <% if(page==totlePage){%>class="disabled" <%}%>><a href="<% if(page >= totlePage ){%> ?page=<%=totlePage%> <%}else{%> ?page=<%=(parseInt(page)+1)%> <%}%>" aria-label="Previous"><span aria-hidden="true">&raquo;</span></a></li>
			</ul>
		</nav>
	</div>
</body>
</html>

<script type="text/javascript">
	

</script>